package com.mars.app.utils;

import com.mars.app.exception.ErrorCodeMsg;
import com.mars.app.exception.GlobalException;
import com.mars.app.exception.SystemException;

/**
 * Created by pengshuo on 2018/1/12 16:23
 * Description: mars assert 工具类
 * Modified By:
 * Version:
 *
 * @author pengshuo
 */
public class MarsAssert {

    /**
     *  false throw exception
     * @param state Boolean
     * @param error error
     */
    public static void check(Boolean state, ErrorCodeMsg error){
        if(!state){
            throw new SystemException(error);
        }
    }

    /**
     * false throw exception
     * @param state
     * @param e
     */
    public static void check(Boolean state,GlobalException e){
        if(!state){
            throw  e;
        }
    }



}
